package com.mlx.mbg.code.inter;

import com.mlx.mbg.code.config.MbgPropertyConfig;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.xml.XmlElement;


import java.util.HashSet;
import java.util.List;
import java.util.Set;

public interface IExtensionMethod{

    boolean checkConfig(ExtensionLevel level, MbgPropertyConfig mbgPropertyConfig, IntrospectedTable introspectedTable);

    default int getOrder(){
        return 100;
    }

    default Set<ExtensionLevel> getExtensionLevelSet(){
        Set<ExtensionLevel> levelSet = new HashSet<>();
        levelSet.add(ExtensionLevel.MODEL);
        levelSet.add(ExtensionLevel.MAPPER);
        levelSet.add(ExtensionLevel.SERVICE);
        levelSet.add(ExtensionLevel.CONTROLLER);
        return levelSet;
    }

    List<Method> buildMethod(IntrospectedTable introspectedTable);

    List<XmlElement> buildSQL(IntrospectedTable introspectedTable);



}
